#!/bin/bash
switch=br0
if [ -n "$1" ]; then
  #delete the specified interface
  tunctl -d $1
  #rlease tap interface from bridge
  brctl delif ${switch} $1
  #shutdown the tap interface
  ip link set $1 down
  exit 0
else
  echo "error: no interface specified"
  exit 1
fi
